package com.atguigu.gmall.feign.product;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.eneity.SkuImage;
import com.atguigu.gmall.product.eneity.SkuInfo;
import com.atguigu.gmall.product.eneity.SpuSaleAttr;
import com.atguigu.gmall.product.vo.CategoryTreeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;
import java.util.List;

@FeignClient("service-product")
@RequestMapping("/api/inner/rpc/product")
public interface SkuDetailFeignClient {


    /**
     * 1.获取商品基本信息
     * @return
     */
    @GetMapping("/skuInfo/{skuId}")
    public Result<SkuInfo> getSkuInfo(@PathVariable Long skuId);

    /**
     * 2.根据c3Id获取skuInfo具体属于哪个分类
     * @param c3Id
     * @return
     */
    @GetMapping("/category/detail/{c3Id}")
    Result<CategoryTreeVo> getCategoryTreeWithC3Id(@PathVariable Long c3Id);

    /**
     * 3.获取商品图片
     * @param skuId
     * @return
     */
    @GetMapping("/skuImages/{skuId}")
    public Result<List<SkuImage>> getSkuImages(@PathVariable Long skuId);

    /**
     * 4.获取商品实时价格
     * @param skuId
     * @return
     */
    @GetMapping("/skuPrice/{skuId}")
    public Result<BigDecimal> getPrice(@PathVariable Long skuId);

    /**
     * 5.获取商品销售属性
     * @param spuId
     * @return
     */
    @GetMapping("/skuSalAttr/{spuId}/{skuId}")
    public Result<List<SpuSaleAttr>> getSpuSaleAttr(@PathVariable Long spuId,@PathVariable Long skuId);

    /**
     * 6.获取ValuesJson
     * @param spuId
     * @return
     */
    @GetMapping("ValuesJson/{spuId}")
    public Result<String> getValuesJson(@PathVariable Long spuId);

}
